<template>
    <div class="">
        <ezm-layout>
            <van-nav-bar
                title="路由演示"
                slot="nav"
            ></van-nav-bar>
            <ezm-scroll-box>
                <van-cell-group title="路由 demo">
                    <van-cell
                        title="正常前进返回"
                        is-link
                        @click="g_navigate.to('/RouteDemoNormalBack')"
                    ></van-cell>
                    <van-cell
                        title="返回并执行钩子函数"
                        is-link
                        @click="g_navigate.to('/RouteDemoHookBack')"
                    ></van-cell>
                    <van-cell
                        title="返回并跳过上一页"
                        is-link
                        @click="g_navigate.to('/RouteDemoBackSkip')"
                    ></van-cell>
                    <van-cell
                        title="返回跳过继承（连续跳过多页）"
                        is-link
                        @click="g_navigate.to('/RouteDemoInherit')"
                    ></van-cell>
                    <van-cell
                        title="返回中间页拦截跳过事件"
                        is-link
                        @click="g_navigate.to('/RouteDemoHookSkip')"
                    ></van-cell>
                </van-cell-group>
                <van-cell-group title="待办任务 demo">
                    <van-cell
                        title="待办任务演示"
                        is-link
                        @click="g_navigate.to('/RouteDemoWaitTask')"
                    ></van-cell>
                </van-cell-group>
            </ezm-scroll-box>
        </ezm-layout>
    </div>
</template>

<script>
    import EzmLayout from "@/components/layout/ezm-layout";
    import EzmScrollBox from "@/components/scroll/ezm-scroll-box";
    import {DialogUtil} from "@/utils/project.util";
    import {NavigateMixin} from "@/mixin/navigate.mixin";

    export default {
        name: 'RouteDemoIndex',
        mixins: [NavigateMixin],
        components: {EzmScrollBox, EzmLayout},
        props: {},
        data() {
            return {}
        },
        computed: {},
        watch: {},
        created() {
        },
        mounted() {
        },
        destroyed() {
        },
        methods: {
            hookBack(p1, p2) {
                setTimeout(() => {
                    DialogUtil.alert(`参数1: ${p1} ; \n 参数2: ${p2} ;`, '钩子函数')
                }, 400);
            },
            hookBack2(...params) {
                setTimeout(() => {
                    DialogUtil.alert(params.map((x, i) => `参数${i + 1} : ${x}`).join('\n'), '拦截后的钩子函数');
                }, 400);
            }
        }
    };
</script>

<style lang="less">

</style>